CREATE TABLE [dbo].[tb_MedicosDeJuntaMedica]
(
[idMedicoJuntaMedica] [int] NOT NULL IDENTITY(1, 1),
[idJuntaMedica] [int] NOT NULL,
[Medico] [int] NOT NULL,
[Rol] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_MedicosDeJuntaMedica] ADD CONSTRAINT [PK_tb_MedicosDeJuntaMedica] PRIMARY KEY NONCLUSTERED  ([idMedicoJuntaMedica]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_MedicosDeJuntaMedica] WITH NOCHECK ADD CONSTRAINT [FK_tb_MedicosDeJuntaMedica_tb_JuntasMedicas] FOREIGN KEY ([idJuntaMedica]) REFERENCES [dbo].[tb_JuntasMedicas] ([idDictamen])
GO
ALTER TABLE [dbo].[tb_MedicosDeJuntaMedica] ADD CONSTRAINT [FK_tb_MedicosDeJuntaMedica_tb_Medicos] FOREIGN KEY ([Medico]) REFERENCES [dbo].[tb_Medicos] ([idMedico])
GO
ALTER TABLE [dbo].[tb_MedicosDeJuntaMedica] ADD CONSTRAINT [FK_tb_MedicosDeJuntaMedica_tb_RolesMedicos] FOREIGN KEY ([Rol]) REFERENCES [dbo].[tb_RolesMedicos] ([idRolMedico])
GO
